package com.zhuliwei.controller;

import com.zhuliwei.domain.ResponseResult;
import com.zhuliwei.domain.entity.Sentence;
import com.zhuliwei.service.SentenceService;
import io.swagger.annotations.Api;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 句子控制层
 *
 * @author zlw
 * @date 2023/5/25
 */
@RestController
@RequestMapping("/sentence")
@Api(tags="句子",description = "句子相关接口")
public class SentenceController {
    @Resource
    private SentenceService sentenceService;

    /**
     * 随机返回一个句子
     *
     * @return Sentence
     */
    @GetMapping
    public ResponseResult<Sentence> getRandomSentence(){
        return sentenceService.getRandomContent();
    }
}
